﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DANGQUYNHTRANG.Programming.Part03.BT02
{
    public partial class Form1 : Form
    {
        private void print(Circle obj, string number, string objname)
        {
            listBox1.Items.Add("------------------Lần thực hiện "+number+"------------------");
            listBox1.Items.Add("Đối tượng "+objname);
            listBox1.Items.Add("Với Bán Kính = " + obj.getRadius +" cm");
            listBox1.Items.Add("Diện tích = " + obj.Area()+" cm2");
        }
        public Form1()
        {
            InitializeComponent();

            Circle objC01 = new Circle(30.5);
            Circle objC02 = new Circle(40);
            Circle objC03 = new Circle(120.5);
            Circle objC04 = new Circle(88.5);

            //Print
            print(objC01, "1", "objC01");
            print(objC02, "2", "objC02");
            print(objC03, "3", "objC03");
            print(objC04, "4", "objC04");

            objC01.getRadius = 30.5;
            objC02.getRadius = 25.5;
            objC03.getRadius = 60;

            //Print
            print(objC01, "1(Updated)", "objC01");
            print(objC02, "2(Updated)", "objC02");
            print(objC03, "3(Updated)", "objC03");
            print(objC04, "4(Updated)", "objC04");
        }
    }
}
